<!DOCTYPE html>
<html>
<head>
    <title>API测试页面</title>
</head>
<body>
    <h1>API测试</h1>
    <button onclick="testAPI()">测试 /api/list_models</button>
    <div id="result"></div>
    
    <script>
        function testAPI() {
            console.log('开始测试API');
            fetch('/api/list_models')
                .then(res => {
                    console.log('响应状态:', res.status);
                    return res.json();
                })
                .then(data => {
                    console.log('API数据:', data);
                    document.getElementById('result').innerHTML = 
                        '<pre>' + JSON.stringify(data, null, 2) + '</pre>';
                })
                .catch(error => {
                    console.error('错误:', error);
                    document.getElementById('result').innerHTML = 
                        '<p style="color:red;">错误: ' + error + '</p>';
                });
        }
        
        console.log('测试页面已加载');
    </script>
</body>
</html>
